package com.xfatm.simplebrowser.ui;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;

/**
 * Created by wenjie on 2018/3/11.
 */

public class ActivityUtil {
    public static void initUI(Activity activity){
        //隐藏标题栏
        if(activity.getClass().getName().equals("android.support.v7.app.AppCompatActivity")||activity.getClass().getSuperclass().getName().equals("android.support.v7.app.AppCompatActivity")){
            AppCompatActivity a=(AppCompatActivity)activity;
            if(a.getSupportActionBar()!=null){
                a.getSupportActionBar().hide();
            }
        }else{
            activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
        }

    }
}
